﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using DataLayer;
using DataLayer.Entities;

namespace MangCuaHang.UserControls
{
    public partial class SearchControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void buttonSearch_Click(object sender, EventArgs e)
        {
            Search.SearchAll("test");
        }

        protected void btLogin_Click(object sender, ImageClickEventArgs e)
        {
            int id = AccountsManager.CheckLogin(textboxEmail.Text.Trim(), textboxPassword.Text.Trim());

            if (id > 0)
            {
                //Response.Redirect("/" + id);
                Session["AccountId"] = id;
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }
    }
}